<template>
    <!-- 对话框表单 -->
    <el-dialog v-model="visible" title="账户明细(默认显示30天内的)">
        <!-- <div>123</div> -->
        <el-table :data="tableData" border style="width: 100%">
            <el-table-column label="日期" prop="create_time"> </el-table-column>
            <el-table-column label="变动原因" prop="memo"> </el-table-column>
            <el-table-column label="变动金额" prop="account_data"> </el-table-column>
            <el-table-column label="变动后余额" prop="account_sum"> </el-table-column>
        </el-table>
    </el-dialog>
</template>

<script setup lang="ts">
import { ref, reactive, inject, watch, nextTick } from 'vue'
import { useI18n } from 'vue-i18n'
import type baTableClass from '/@/utils/baTable'
import { regularPassword } from '/@/utils/validate'
import type { FormInstance, FormItemRule } from 'element-plus'
import FormItem from '/@/components/formItem/index.vue'
import router from '/@/router/index'
import { buildValidatorData } from '/@/utils/validate'
import { useConfig } from '/@/stores/config'
import createAxios from '/@/utils/axios'
const config = useConfig()
const formRef = ref<FormInstance>()
const { t } = useI18n()
const visible = ref(false)
const props = defineProps({
    modelValue: Boolean,
    data: Object,
})
watch(
    () => props.modelValue,
    (val) => {
        // console.log('data',props.data)
        visible.value = val
        if (val) {
            nextTick(async () => {
                // tagActive.value = 0
                if (props.data?.member_id) {
                    // await getGoodsTree()
                    await GetUserInfo()
                }
            })
        }
    }
)
// 获取用户明细
const tableData: any = ref([])
const GetUserInfo = () => {
    createAxios({ url: '/admin/member.Account/balance', method: 'get', params: { id: props.data?.member_id } }).then((res) => {
        tableData.value = res.data.data
        console.log('res', tableData.value)
    })
}
</script>

<style scoped lang="scss">
.avatar-uploader {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: var(--el-border-radius-small);
    box-shadow: var(--el-box-shadow-light);
    border: 1px dashed var(--el-border-color);
    cursor: pointer;
    overflow: hidden;
    width: 110px;
    height: 110px;
}
.avatar-uploader:hover {
    border-color: var(--el-color-primary);
}
.avatar {
    width: 110px;
    height: 110px;
    display: block;
}
.image-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}
</style>
